<template>
	<div class="flex items-center justify-center h-screen">
		<div class="flex-auto w-full max-w-4xl">
			<div class="flex flex-col items-center">
				<img src="@/assets/avatar.jpg" alt="Avatar" class="w-24 h-24 rounded-full mb-4" />
				<h1 class="text-2xl font-bold mb-4">姓名</h1>
				<TimeLine :timeline-items="timelineItems"></TimeLine>
			</div>
		</div>
	</div>
</template>

<script setup lang="ts">
	import { useRoute } from 'vue-router'
	import { onMounted, ref } from 'vue'
	import { _getUserInfo } from '@/api/user'
	const route = useRoute()
	const registerDate = ref<string>('')
	const timelineItems = [`Create the account at ${registerDate.value}`]
	onMounted(() => {
		_getUserInfo(null, route.params.id as string).then((data) => {
			console.log()
			registerDate.value = data.createTime
		})
	})
</script>
